<?php
namespace User\Controller;

class IndexController extends MainController {

    public function index(){
        if (!$this->baseInfo) {
            $this->redirect(U("Profile/index"));
        }

       //系统消息
        $sysmsg=M("Article")->where("cid=4")->order("id desc")->select();
        $this->assign("sysmsg",$sysmsg);

        //日历
        $calendar = M('Event')->order('id desc')->select();
        foreach ($calendar as $key => $value) {
           $calendar[$key]['date'] = strtotime("last month",$value['date']);
        }
        $this->assign('calendar',$calendar);         

    	$this->display();
    }   
}